<?php if (count($this->errors) > 0) {
    ?>

    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <?php
        foreach ($this->errors as $errorName => $error) {
            foreach ($error as $message) {
                echo "<strong>$errorName : </strong>$message <br />";
            }
        }
        ?>
    </div>
<?php } ?>

<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">Main Page Settings</h3>
    </div>
    <div class="panel-body">

        <!-- Nav tabs -->
        <ul class="nav nav-tabs">
            <li class="active"><a href="#general" data-toggle="tab">General</a></li>
            <li><a href="#services" data-toggle="tab">Services</a></li>
            <li><a href="#social" data-toggle="tab">Social Links</a></li>

        </ul>

        <div class="tab-content">
            <div class="tab-pane fade in active" id="general">...</div>
            <div class="tab-pane fade" id="services">
                <form action="<?php echo $this->baseUrl() . "/administration/main/index" ?>" name="service" method="post" enctype="multipart/form-data">
                    <?= $this->servicesForm->id ?>
                    <?php $number = array('One', 'Two', 'Three');?>
                    <?php for($i = 0; $i <3; $i++) {?>
                    <div class="form-group">
                        <label for="service<?=$number[$i]?>Title">Service <?=$number[$i]?> Title</label>
                        <?php echo $this->servicesForm->{"serviceTitle".$number[$i]} ?>
                    </div>
                    <div class="form-group">
                        <label for="service<?=$number[$i]?>Body">Service <?=$number[$i]?> Body</label>
                    <?php echo $this->servicesForm->{"serviceBody".$number[$i]} ?>
                    </div>
                    <div class="form-group">
                        <label for="service<?=$number[$i]?>Image">Service <?=$number[$i]?> Image</label>
                        <?php echo $this->servicesForm->{"serviceImage".$number[$i]} ?>
                    </div>
                    <div class="form-group">
                        <label for="readMoreLink<?=$number[$i]?>">Read More Link</label>
                        <?php echo $this->servicesForm->{"readMoreLink".$number[$i] } ?>
                    </div>
                    <div class="separator"></div>
                    <?php }?>
                    <?php echo $this->servicesForm->submit ?>
                </form>
            </div>
            <div class="tab-pane fade" id="social">...</div>
        </div>  
    </div>
</div>